package com.pl.spring.cloud.alibaba.consumer.controller;

import com.pl.spring.cloud.alibaba.consumer.service.EchoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
public class TestFeignController {

    @Autowired
    private EchoService echoService;

    @GetMapping(value = "/testFeign/{params}")
    public String testFeign(@PathVariable String params){
        return echoService.echoTest(params);
    }

    @GetMapping(value = "/testLB")
    public String testLB(){
        return echoService.testLB();
    }

    @Value("${user.name}")
    private String userName;

    @GetMapping(value = "/testConfig")
    public String testFeign(){
        return echoService.echoTest(userName);
    }
}
